<?php use_stylesheet('/enermaatik/arveldus.css') ?>
<?php slot('article') ?>
<?php include_component('memberzoneMenu', 'render') ?>
<?php include_component('headerMenu', 'breadCrumbs') ?>

<div class="clear"></div>
<div class="ccontentbox">
	<div class="ccontent">
		<div class="korvsisu">
			<?php include_partial('memberzoneAddresses/existingAddresses', array('shippingAddresses' => $shippingAddresses, 'billingAddresses' => $billingAddresses)) ?>
			<a target="formContainer"></a>
			<div id="formContainer"></div>
		</div>
	</div>

</div>



<script type="text/javascript">
	$('.edit_address').click(function(e){
		e.preventDefault();

		// set radio button
		$(this).parents('.korvinfoboxrow').find('.radio').trigger('click');

		$.get('<?php echo LinkGen::getInstance(LinkGen::STRUCTURE_ACTIONS)->link(null, array('module' => 'memberzoneAddresses', 'action' => 'getForm')) ?>',{address: $(this).attr('href')}, function(data){
			$('#formContainer').html(data.formHTML);
			window.location.hash = 'formContainer';
		},'json');

		return false;
	});
</script>

<script type="text/javascript">
$('.radio').click(function(){
$('.radio').removeClass("active");
$(this).addClass("active");
});

$('.pankradio').click(function(){
$('.pankradio').removeClass("active");
$(this).addClass("active");
});

$('.checkbox').click(function(){
$('.checkbox').addClass("active");
});
</script>	
<?php end_slot() ?>